package com.sc.nft.controller;

import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.annotation.UserLogin;
import com.sc.nft.controller.request.IdRequest;
import com.sc.nft.entity.vo.MallUserActivityRankingDetailVO;
import com.sc.nft.service.MallUserActivityRankingDetailService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/user/activity/ranking/detail")
@Api(tags = "用户排行榜模块")
public class UserActivityRankingDetailController {

    private final MallUserActivityRankingDetailService mallUserActivityRankingDetailService;

    @PostMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "排行榜", notes = "排行榜", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result<MallUserActivityRankingDetailVO> queryActivityRankingCyclesList(@RequestBody IdRequest request) {
        MallUserActivityRankingDetailVO mallUserActivityRankingDetailVO = mallUserActivityRankingDetailService.queryMallUserActivityRankingDetailList(request.getId());
        return Result.success(mallUserActivityRankingDetailVO);
    }
}
